using BlazorAdmin.Models;
using BootstrapBlazor.Components;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace BlazorAdmin.Interface
{
    /// <summary>
    /// Tasks 接口
    /// </summary>
    public interface IJob
    {
        /// <summary>
        /// 保存、更新
        /// </summary>
        /// <param name="entity">实体对象</param>
        /// <returns>错误消息</returns>
        Task<string> Save(Job entity);

        Task<List<Job>> Query(JobStatus status);

        /// <summary>
        /// 分页查询
        /// </summary>
        /// <param name="query">查询参数集合</param>
        /// <returns>分页数据</returns>
        Task<QueryData<Job>> Query(AppQueryOption query);

        /// <summary>
        /// 物理删除实例
        /// </summary>
        /// <param name="ids">主键id集合</param>
        /// <returns></returns>
        Task<bool> Delete(List<int> ids);
    }
}
